Create integration key for self-defined app with event integration via PagerDuty REST API

Hi all,

I have created an PagerDuty App with event integration enabled and would like to create this integration key for my service but not sure how I can do it via PagerDuty API. I can manual create it via PagerDuty web UI but not by sending a POST request.

Currently I have tried sending the POST request with the following json body to https://api.pagerduty.com/services/{{ existing service id}}/integrations:
{
“integration”: {
“type”: “app_event_transform_inbound_integration_reference”,
“summary”: “{{ my app name }}”,
“name”: “{{ my app name }}”,
}
}
with header:
Authorization: “Token token={{ pagerduty api key }}”
Accept: “application/vnd.pagerduty+json;version=2”
Content-Type: “application/json”
but got a 400 response saying:
{
“message”: “Invalid Input Provided”,
“code”: 2001,
“errors”: [
“Type cannot be empty.”
]
}

Could anyone please advise any experience on creating event integration via PagerDuty REST API call?

created a support ticket and got the response from the support team, this payload works for me now:
{
“integration”: {
“type”: “app_event_transform_inbound_integration”,
“summary”: “SUMMARY HERE”,
“name”: “NAME HERE”,
“service”: {
“id”: “NEW SERVICE ID HERE (PXXX FORMAT)”,
“type”: “service_reference”
},
“vendor”: {
“id”: “YOUR APP ID HERE (PXXX FORMAT)”,
“type”: “vendor_reference”,
“summary”: “SUMMARY HERE”,
“html_url”: null
}
}
}
the best way to get the information necessary for the vendor object is to make a GET request for the app event integration on your app’s test service (name should start with [Test Service]) and use the values you receive in the payload for the POST request to a new service.

Thanks to the support team

1 Like